package com.weather.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.weather.vo.Weather;
import com.weather.vo.WeatherResponse;

/**
 * @Description 天气服务接口实现类
 *
 * @author 堆堆堆
 * @date 2018年5月31日 下午6:09:14
 */
@Service
public class WeatherReportServiceImpl implements WeatherReportService {

	@Autowired
	private DataClient dataClient;

	/**
	 * @Description 根据城市 id 查询天气信息
	 *
	 * @param cityId
	 * @return
	 */
	@Override
	public Weather getDataByCityId(String cityId) {

		// 由天气数据API微服务来提供
		WeatherResponse resp = dataClient.getDataByCityId(cityId);
		Weather data = resp.getData();
		return data;
	}
}
